<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title><?php echo C('SITE_INFO.name');?></title>
<script type="text/javascript" src="__PUBLIC__/scripts/jquery-1.7.2.min.js"></script>
<link href="__PUBLIC__/Catalog/css/common.css" rel="stylesheet" type="text/css" />

<link href="__PUBLIC__/Catalog/css/collect.css" rel="stylesheet" type="text/css" />
</head>
<body>

<div class="main">
   <div class="title">
         <div class="title1">
             <a href="<?php echo U('Membership/index');?>" id="back"> < </a>我的收藏
         </div>
   </div>
   <div class="historyList">
        <ul>
           <?php if(is_array($collectlist)): foreach($collectlist as $key=>$vo): ?><li id="del<?php echo ($vo["products_id"]); ?>">
               <table>
                   <tr>
                       <td><img src="__PUBLIC__/images/products/<?php echo ($vo["products_image"]); ?>" width="73" height="63" /></td>
                       <td style="width:280px;">
                          <dl>
                             <dd id="li1">
	                             <span class="spanx1"><a href="<?php echo U('Products/detail');?>?pid=<?php echo ($vo["products_id"]); ?>"><?php echo ($vo["products_name"]); ?></a></span>
	                             <span class="spanx2"  onclick="javascript:delcollect('del<?php echo ($vo["products_id"]); ?>','<?php echo ($vo["products_id"]); ?>')"></span>
                             </dd>
                             <dd id="li2"><span class="span1">
                              <a  class="span1" href="<?php echo U('Products/index');?>?cid=<?php echo ($vo["cate"]["categories_id"]); ?>"><?php echo ($vo["cate"]["categories_name"]); ?></a>
                            
                            </span><span class="span2"><?php echo ($vo["products_date_added"]); ?></span></dd>
                          </dl>
                       </td>
                   </tr>
               </table>
           </li><?php endforeach; endif; ?>
        </ul>
   </div>
</div>
<script>
function delcollect(obj,pid){
	$.ajax({
		type:"post",
		url:"<?php echo U('Membership/delcollect');?>",
		datatype:'json',
		data:{pid:pid},
		success:function(result){
			datacontent =window.JSON.parse(result);
				alert(datacontent.msg);
				$('#'+obj).remove();
		},
		error: function(XMLHttpRequest, textStatus, errorThrown) {
			alert(XMLHttpRequest.status);
			alert(XMLHttpRequest.readyState);
			alert(textStatus);
		},
	});
}
</script>
<div class="index-foot">
    <div class="index-foot2">
            <ul>
              <li>
                  <dl>
                      <dd class="index-dds"><a href="<?php echo U('Index/index');?>"><img src="__PUBLIC__/Catalog/images/house.png" /></a></dd>
                      <dd><a href="<?php echo U('Index/index');?>">首页</a></dd>
                  </dl>
              </li>
              <li>
                  <dl>
                      <dd class="index-dds"><a href="<?php echo U('Products/index');?>"><img src="__PUBLIC__/Catalog/images/cate1.png" /></a></dd>
                      <dd><a href="<?php echo U('Products/index');?>">商品</a></dd>
                  </dl>
              </li>
              <li>
                  <dl>
                      <dd><a href="<?php echo U('Mproducts/publish');?>"><img src="__PUBLIC__/Catalog/images/jia.png"style=" width:50px; height:50px;" /></a></dd>
                  </dl>
              </li>
              <li>
                  <dl>
                      <dd class="index-dds"><a href="<?php echo U('Membership/leaveword');?>"><img src="__PUBLIC__/Catalog/images/<?php if($count > 0): ?>message-hot.png<?php else: ?>message.png<?php endif; ?>" /></a></dd>
                      <dd><a href="<?php echo U('Membership/leaveword');?>">信息</a></dd>
                  </dl>
              </li>
              <li>
                  <dl>
                      <dd class="index-dds"><a href="<?php echo U('Membership/index');?>?uid=<?php echo ($uid); ?>"><img src="__PUBLIC__/Catalog/images/men.png" /></a></dd>
                      <dd><a href="<?php echo U('Membership/index');?>?uid=<?php echo ($uid); ?>">我的</a></dd>
                  </dl>
              </li>
            </ul>       
    </div>
</div>
</body>
</html>